use 'math'

-- Input section,   phần nhập số liệu
ns = 200;               -- Number of grid cells,  số ô lưới
d = 25;                 -- Height of active profile, chiều cao mặt cắt hoạt động
dt = 0.1;              -- Time step (yr), bước thời gian (năm)
nt = 400;               -- Number of time steps, số bước thời gian
interval = 20;           -- Output interval, Khoảng thời gian in kết quả
sbr = 3			-- Number of breakpoints in spline representation of the shoreline
				-- Số điểm gẫy khúc trong phép xấp xỉ đường bờ bằng đường cong spline

-- Raw data, số liệu gốc

-- global coordinates, used as graphics
-- tọa độ địa lý, dùng để vẽ bản đồ
ijmuiden = [[
             93790.1    481811.1
             94786.1    484317.2
             95078.2    485030.6
             95447.5    485940.1
             95784.2    486756.9
             96102.3    487559.0
             96494.8    488523.6
             96891.1    489535.5
             97252.4    490379.2
             97656.2    491398.5
             97881.6    491960.4
             98045.8    492311.3
             98260.8    492886.2
             98402.4    493272.6
             98558.1    493834.9
             98649.7    494042.1
             98801.1    494790.3
             98821.0    494928.2
             98895.8    495681.3
             98864.0    496195.1
             98797.2    496627.0
             98698.9    497030.2
             98570.5    497333.3
             98505.1    497384.0
             98472.3    497395.6
             97399.6    497019.2
             97244.3    497015.1
             97182.2    497041.7
             97037.2    497243.9
             96935.5    497371.0
             96862.5    497618.0
             96861.9    497681.3
             96890.9    497694.1
             96914.5    497653.6
             96952.7    497492.4
             96964.0    497459.5
             97019.1    497369.6
             97109.4    497242.5
             97182.8    497125.5
             97262.6    497071.7
             97363.6    497067.7
             97506.8    497103.3
             97777.9    497203.5
             98441.2    497441.6
             98416.2    497498.6
             98433.7    497499.5
             98483.1    497441.4
             99284.5    497037.0
             99371.6    497169.6
             99450.4    497408.3
             99494.7    497405.6
             99666.7    497441.1
             99696.0    497503.2
            100149.5    497560.1
            100185.7    497531.0
            100174.6    497512.1
            100042.5    497492.4
             99905.4    497392.9
            100034.6    497206.4
            100200.9    496995.2
            100655.6    496700.8
            100725.9    496791.1
            100254.0    497107.6
            100145.4    497324.9
            100154.2    497366.7
            100282.6    497437.7
            101073.5    496943.7
            101121.9    496952.4
            101165.2    497034.4
            100349.1    497547.6
            100325.1    497527.7
            100272.1    497569.9
            100277.1    497582.3
            100798.7    497617.4
            100798.9    497645.3
            100826.8    497649.1
            100820.6    497678.1
            100846.0    497679.4
            100853.2    497652.5
            100820.4    497660.1
            100946.9    497651.0
            100954.1    497621.6
            102488.2    497600.9
-999 -999
            100553.9    497714.9
            100666.4    497705.3
            100715.9    497730.4
            100789.0    497730.1
            100795.2    497687.2
            100892.8    497684.1
            100888.1    497723.1
            101579.7    497723.3
            101578.4    497738.8
            101687.4    497739.2
            101692.3    497721.7
            102181.6    497703.7
            102177.1    497766.0
            101901.3    497778.4
            101898.5    497730.6
            101773.6    497747.7
            101763.5    497790.6
            101545.0    497807.2
            101537.6    497817.2
            101485.3    497824.0
            101460.6    497845.6
            101485.7    497875.8
            101320.3    497871.7
            101297.2    497847.4
            101321.0    497824.9
            101484.3    497822.5
            101222.4    497825.4
            101223.7    497802.5
            100797.4    497790.8
            100561.5    497733.7
-999 -999
            102333.8    498116.9
            102320.2    498016.9
            101802.3    498082.9
            101800.2    498136.2
            101565.0    498184.3
            101537.3    498222.4
            100924.8    498288.9
            100925.9    498301.4
            101064.1    498338.5
            101551.7    498286.6
            101564.3    498453.9
            101497.8    498492.1
            101421.7    498492.6
            101264.3    498426.1
            101110.1    498448.4
            101396.9    498588.9
            101707.8    498544.3
            101726.1    498593.6
            102042.0    498547.5
            102064.0    498637.1
            101668.7    498725.4
            101661.3    498737.9
            101423.7    498793.5
            101194.4    498687.1
            101165.4    498738.1
            100547.9    498516.2
            100525.3    498561.6
            100478.6    498581.3
            100355.8    498533.6
            100326.5    498475.5
            100271.4    498417.5
            100280.1    498383.6
            100020.1    498297.2
            100060.3    498426.6
            100060.5    498598.5
             99981.0    498630.3
             99733.9    498241.0
             99700.8    498204.2
             99652.8    498180.6
             99277.7    498078.5
             98795.7    498092.5
             98664.3    498092.2
             98520.0    498043.7
             98376.5    497956.7
             98347.3    497984.8
             98532.8    498092.9
             98568.2    498098.7
             98035.4    498246.1
             97988.7    498258.8
             97922.0    498258.1
             97693.3    498168.2
             97570.2    498076.6
             97566.5    498118.1
             97641.7    498203.8
             97837.0    498279.0
             97995.5    498312.1
             98221.8    498264.0
             98666.2    498150.5
             98840.3    498129.1
             99221.2    498128.1
             99309.1    498234.2
             99386.0    498416.2
             99466.1    498625.6
             99648.0    498933.6
             99847.9    499340.1
             99928.8    499520.6
             99912.7    499558.5
            100147.8    500090.4
            100215.1    500312.8
            100256.3    500445.1
            100405.7    500807.6
            100451.4    501016.1
            100563.8    501216.8
            100728.9    501838.8
            100778.0    502171.4
            100868.8    502564.6
            100936.7    502890.6
            101025.7    503305.2
            101174.1    503900.9
            101331.2    504516.4
            101472.5    505228.2
            101607.5    505891.7
            101776.1    506889.4
            101957.3    507832.7
            102032.6    508355.1
            102033.4    508472.6
            102190.6    509260.6
            102385.9    510444.0
            102468.2    510829.7
            102481.6    511270.2
            102578.3    511797.3
            102660.0    512457.6
            102750.5    512872.2
            102835.3    513631.2
            102915.8    514111.6
            102994.3    514753.0
            103017.6    514802.2
-999 -999
            102773.7    498077.7
            102456.7    498180.6
            101603.9    498277.8
            101620.1    498462.1
            101940.1    498426.5
            102055.6    498348.6
            102657.0    498270.7
            102876.6    498189.7
            103123.7    498068.4
            103139.3    498085.7
            103066.4    498204.2
            102987.0    498251.4
            102368.6    498396.3
            102377.5    498462.0
            103192.4    498281.7
            103223.7    498046.4
            103383.1    497919.0
]]



-- initial coastline data 
-- tọa độ đường bờ ban đầu
xy1967 = [[
  1.0994500e+005  5.5114600e+005
  1.0987800e+005  5.5091400e+005
  1.0981800e+005  5.5072700e+005
  1.0979300e+005  5.5056000e+005
  1.0977200e+005  5.5036500e+005
  1.0975100e+005  5.5016400e+005
  1.0972800e+005  5.4997500e+005
  1.0971100e+005  5.4977600e+005
  1.0971400e+005  5.4958100e+005
  1.0971700e+005  5.4938600e+005
  1.0973500e+005  5.4918600e+005
  1.0973700e+005  5.4898500e+005
  1.0972100e+005  5.4878400e+005
  1.0972400e+005  5.4858500e+005
  1.0971600e+005  5.4838300e+005
  1.0969900e+005  5.4818400e+005
  1.0968200e+005  5.4798200e+005
  1.0966000e+005  5.4778000e+005
  1.0964700e+005  5.4758000e+005
  1.0962500e+005  5.4738000e+005
  1.0962300e+005  5.4718100e+005
  1.0961500e+005  5.4698200e+005
  1.0960800e+005  5.4677900e+005
  1.0960600e+005  5.4657800e+005
  1.0959500e+005  5.4637700e+005
  1.0958400e+005  5.4617800e+005
  1.0955800e+005  5.4598000e+005
  1.0954700e+005  5.4578000e+005
  1.0952100e+005  5.4558400e+005
  1.0951900e+005  5.4538100e+005
  1.0949800e+005  5.4518000e+005
  1.0947700e+005  5.4498000e+005
  1.0944900e+005  5.4478000e+005
  1.0942400e+005  5.4458100e+005
  1.0939300e+005  5.4438300e+005
  1.0933800e+005  5.4418700e+005
  1.0930900e+005  5.4399600e+005
  1.0927800e+005  5.4380200e+005
  1.0924700e+005  5.4360100e+005
  1.0919000e+005  5.4339900e+005
  1.0913900e+005  5.4320100e+005
  1.0909400e+005  5.4300800e+005
  1.0903800e+005  5.4281700e+005
  1.0899100e+005  5.4262000e+005
  1.0893900e+005  5.4242600e+005
  1.0890600e+005  5.4217000e+005
  1.0880900e+005  5.4189400e+005
  1.0873100e+005  5.4159300e+005
  1.0864400e+005  5.4129500e+005
  1.0857300e+005  5.4100300e+005
  1.0849300e+005  5.4071300e+005
  1.0840700e+005  5.4042400e+005
  1.0833100e+005  5.4013300e+005
  1.0826600e+005  5.3984000e+005
  1.0818500e+005  5.3955000e+005
  1.0810500e+005  5.3925900e+005
  1.0802200e+005  5.3902300e+005
  1.0796600e+005  5.3883100e+005
  1.0790700e+005  5.3863200e+005
  1.0785300e+005  5.3843000e+005
  1.0779600e+005  5.3823600e+005
  1.0773200e+005  5.3804200e+005
  1.0768200e+005  5.3784300e+005
  1.0762700e+005  5.3764500e+005
  1.0757300e+005  5.3744900e+005
  1.0753400e+005  5.3724900e+005
  1.0748500e+005  5.3704900e+005
  1.0744900e+005  5.3684200e+005
  1.0741300e+005  5.3663800e+005
  1.0738400e+005  5.3643800e+005
  1.0732500e+005  5.3623900e+005
  1.0727000e+005  5.3603900e+005
  1.0718600e+005  5.3584800e+005
  1.0715000e+005  5.3564400e+005
  1.0709100e+005  5.3544800e+005
  1.0703600e+005  5.3524700e+005
  1.0697500e+005  5.3504700e+005
  1.0691200e+005  5.3480200e+005
  1.0680900e+005  5.3453000e+005
  1.0670400e+005  5.3430100e+005
  1.0661900e+005  5.3413300e+005
  1.0658000e+005  5.3396200e+005
  1.0652300e+005  5.3380000e+005
  1.0645500e+005  5.3362300e+005
  1.0639500e+005  5.3339900e+005
  1.0631200e+005  5.3311900e+005
  1.0620700e+005  5.3283900e+005
  1.0610500e+005  5.3257900e+005
  1.0600800e+005  5.3233700e+005
  1.0591900e+005  5.3209400e+005
  1.0577700e+005  5.3182800e+005
  1.0571700e+005  5.3171700e+005
  1.0564900e+005  5.3161600e+005
  1.0555100e+005  5.3140700e+005
  1.0449000e+005  5.2635800e+005
  1.0445100e+005  5.2611200e+005
  1.0442200e+005  5.2591600e+005
  1.0439600e+005  5.2571300e+005
  1.0437600e+005  5.2555000e+005
  1.0436200e+005  5.2538900e+005
  1.0435300e+005  5.2524200e+005
  1.0430500e+005  5.2488600e+005
  1.0427700e+005  5.2471200e+005
  1.0423900e+005  5.2455500e+005
  1.0424000e+005  5.2439300e+005
  1.0421800e+005  5.2424600e+005
  1.0415200e+005  5.2389600e+005
  1.0411800e+005  5.2372900e+005
  1.0408100e+005  5.2337600e+005
  1.0404700e+005  5.2308300e+005
  1.0400200e+005  5.2286100e+005
  1.0402500e+005  5.2272500e+005
  1.0402600e+005  5.2247600e+005
  1.0399800e+005  5.2222500e+005
  1.0397900e+005  5.2197600e+005
  1.0388500e+005  5.2173600e+005
  1.0384600e+005  5.2149000e+005
  1.0377300e+005  5.2124700e+005
  1.0376900e+005  5.2099600e+005
  1.0376900e+005  5.2074000e+005
  1.0371500e+005  5.2049400e+005
  1.0366200e+005  5.2025000e+005
  1.0360300e+005  5.2000500e+005
  1.0353900e+005  5.1975600e+005
  1.0354500e+005  5.1950400e+005
  1.0356500e+005  5.1925000e+005
  1.0353600e+005  5.1900200e+005
  1.0350200e+005  5.1875100e+005
  1.0347300e+005  5.1850300e+005
  1.0345400e+005  5.1825300e+005
  1.0338000e+005  5.1800900e+005
  1.0333500e+005  5.1776200e+005
  1.0330300e+005  5.1751300e+005
  1.0327500e+005  5.1726400e+005
  1.0325800e+005  5.1701500e+005
  1.0321500e+005  5.1676800e+005
  1.0318800e+005  5.1651900e+005
  1.0313500e+005  5.1627200e+005
  1.0310300e+005  5.1602500e+005
  1.0308500e+005  5.1577700e+005
  1.0309700e+005  5.1552400e+005
  1.0304800e+005  5.1527800e+005
  1.0302400e+005  5.1503000e+005
  1.0298100e+005  5.1478600e+005
  1.0291900e+005  5.1454300e+005
  1.0286500e+005  5.1429800e+005
  1.0284100e+005  5.1404900e+005
  1.0283200e+005  5.1379600e+005
  1.0280300e+005  5.1354700e+005
  1.0280900e+005  5.1329400e+005
  1.0279600e+005  5.1304400e+005
  1.0273100e+005  5.1279400e+005
  1.0265700e+005  5.1255200e+005
  1.0264900e+005  5.1230200e+005
  1.0262500e+005  5.1205200e+005
  1.0258100e+005  5.1180400e+005
  1.0251200e+005  5.1156100e+005
  1.0249900e+005  5.1131100e+005
  1.0245100e+005  5.1106600e+005
  1.0246600e+005  5.1081000e+005
  1.0241300e+005  5.1056500e+005
  1.0234500e+005  5.1032100e+005
  1.0228100e+005  5.1007700e+005
  1.0228100e+005  5.0982400e+005
  1.0224800e+005  5.0957600e+005
  1.0220000e+005  5.0933100e+005
  1.0215100e+005  5.0908600e+005
  1.0209200e+005  5.0884200e+005
  1.0204300e+005  5.0859600e+005
  1.0201800e+005  5.0834800e+005
  1.0202900e+005  5.0809400e+005
  1.0198900e+005  5.0784700e+005
  1.0193300e+005  5.0760400e+005
  1.0186700e+005  5.0736100e+005
  1.0183100e+005  5.0711400e+005
  1.0178500e+005  5.0686800e+005
  1.0173400e+005  5.0662300e+005
  1.0168800e+005  5.0637700e+005
  1.0165800e+005  5.0613000e+005
  1.0162100e+005  5.0588000e+005
  1.0157500e+005  5.0563400e+005
  1.0150500e+005  5.0539400e+005
  1.0145900e+005  5.0514800e+005
  1.0138300e+005  5.0490700e+005
  1.0135700e+005  5.0465800e+005
  1.0129100e+005  5.0441600e+005
  1.0125000e+005  5.0417000e+005
  1.0118900e+005  5.0392600e+005
  1.0112800e+005  5.0368400e+005
  1.0106100e+005  5.0344300e+005
  1.0100600e+005  5.0320100e+005
  1.0094900e+005  5.0295600e+005
  1.0092500e+005  5.0270300e+005
  1.0086000e+005  5.0246300e+005
  1.0080400e+005  5.0221900e+005
  1.0075600e+005  5.0197200e+005
  1.0070000e+005  5.0173000e+005
  1.0065800e+005  5.0148200e+005
  1.0058700e+005  5.0124300e+005
  1.0045200e+005  5.0101500e+005
  1.0041000e+005  5.0076800e+005
  1.0031400e+005  5.0054600e+005
  1.0022000e+005  5.0031300e+005
  1.0013700e+005  5.0007700e+005
  1.0006300e+005  4.9983800e+005
  9.9970000e+004  4.9960700e+005
  9.9883000e+004  4.9937300e+005
  9.9755000e+004  4.9913600e+005
  9.9629000e+004  4.9891600e+005
  9.9556000e+004  4.9867800e+005
  9.9444000e+004  4.9845200e+005
  9.9342000e+004  4.9821200e+005
  9.9043000e+004  4.9623400e+005
  9.9012000e+004  4.9598100e+005
  9.9044000e+004  4.9571000e+005
  9.8961000e+004  4.9547500e+005
  9.8928000e+004  4.9520200e+005
  9.8897000e+004  4.9495000e+005
  9.8819000e+004  4.9471300e+005
  9.8758000e+004  4.9447000e+005
  9.8703000e+004  4.9422500e+005
  9.8624000e+004  4.9398700e+005
  9.8560000e+004  4.9374500e+005
  9.8476000e+004  4.9350900e+005
  9.8402000e+004  4.9327000e+005
  9.8318000e+004  4.9303500e+005
  9.8220000e+004  4.9280300e+005
  9.8141000e+004  4.9256500e+005
  9.8063000e+004  4.9233000e+005
  9.7968000e+004  4.9210000e+005
  9.7847000e+004  4.9188000e+005
  9.7766000e+004  4.9164300e+005
  9.7682000e+004  4.9140900e+005
  9.7610000e+004  4.9116900e+005
  9.7516000e+004  4.9093800e+005
  9.7374000e+004  4.9072500e+005
  9.7304000e+004  4.9048500e+005
  9.7208000e+004  4.9025100e+005
  9.7151000e+004  4.9000600e+005
  9.7056000e+004  4.8977400e+005
  9.6939000e+004  4.8955200e+005
  9.6880000e+004  4.8930800e+005
  9.6779000e+004  4.8907900e+005
  9.6688000e+004  4.8884800e+005
  9.6577000e+004  4.8862400e+005
  9.6499000e+004  4.8838600e+005
  9.6393000e+004  4.8815900e+005
  9.6300000e+004  4.8792500e+005
  9.6107000e+004  4.8746300e+005
  9.6006000e+004  4.8723600e+005
  9.5896000e+004  4.8700900e+005
  9.5845000e+004  4.8676000e+005
  9.5706000e+004  4.8654600e+005
  9.5624000e+004  4.8631000e+005
  9.5536000e+004  4.8607500e+005
  9.5439000e+004  4.8584400e+005
  9.5351000e+004  4.8561100e+005
  9.5245000e+004  4.8538300e+005
  9.5163000e+004  4.8514800e+005
  9.5057000e+004  4.8491900e+005
  9.4969000e+004  4.8468600e+005
  9.4872000e+004  4.8445500e+005
  9.4776000e+004  4.8422400e+005
  9.4679000e+004  4.8399300e+005
  9.4568000e+004  4.8376700e+005
  9.4472000e+004  4.8353800e+005
  9.4374000e+004  4.8330600e+005
  9.4283000e+004  4.8307400e+005
  9.4173000e+004  4.8285000e+005
  9.4077000e+004  4.8262000e+005
  9.3980000e+004  4.8239000e+005
  9.3878000e+004  4.8215900e+005
  9.3786000e+004  4.8192600e+005
  9.3649000e+004  4.8171400e+005
  9.3556000e+004  4.8148000e+005
  9.3484000e+004  4.8129200e+005
  9.3393000e+004  4.8106100e+005
  9.3229000e+004  4.8086300e+005
  9.3153000e+004  4.8063800e+005
  9.3054000e+004  4.8039200e+005
  9.2943000e+004  4.8016700e+005
  9.2833000e+004  4.7994200e+005
  9.2714000e+004  4.7972200e+005
  9.2613000e+004  4.7949200e+005
  9.2503000e+004  4.7926700e+005
  9.2412000e+004  4.7903500e+005
  9.2301000e+004  4.7881000e+005
  9.2163000e+004  4.7859600e+005
  9.2053000e+004  4.7837100e+005
  9.1934000e+004  4.7815100e+005
  9.1815000e+004  4.7793100e+005
  9.1713000e+004  4.7770100e+005
  9.1621000e+004  4.7746800e+005
  9.1512000e+004  4.7724400e+005
  9.1392000e+004  4.7702300e+005
  9.1300000e+004  4.7678800e+005
  9.1157000e+004  4.7658400e+005
  9.1049000e+004  4.7635700e+005
  9.0949000e+004  4.7612700e+005
  9.0840000e+004  4.7590000e+005
  9.0723000e+004  4.7567900e+005
  9.0606000e+004  4.7545900e+005
  9.0471000e+004  4.7524600e+005
  9.0345000e+004  4.7502900e+005
  9.0228000e+004  4.7480800e+005
  9.0111000e+004  4.7458700e+005
  9.0002000e+004  4.7436200e+005
  8.9893000e+004  4.7413300e+005
  8.9759000e+004  4.7392300e+005
  8.9650000e+004  4.7369700e+005
  8.9533000e+004  4.7347600e+005
  8.9406000e+004  4.7325700e+005
  8.9298000e+004  4.7303100e+005
  8.9146000e+004  4.7283100e+005
  8.9037000e+004  4.7260400e+005
  8.8930000e+004  4.7237900e+005
  8.8815000e+004  4.7215700e+005
  8.8648000e+004  4.7196400e+005
  8.8577000e+004  4.7171800e+005
  8.8418000e+004  4.7151900e+005
  8.8282000e+004  4.7130900e+005
  8.8162000e+004  4.7108800e+005
  8.8031000e+004  4.7087800e+005
  8.7915000e+004  4.7065300e+005
  8.7791000e+004  4.7043600e+005
  8.7668000e+004  4.7021800e+005
  8.7518000e+004  4.7001500e+005
  8.7422000e+004  4.6978500e+005
  8.7310000e+004  4.6956000e+005
  8.7164000e+004  4.6935700e+005
  8.7034000e+004  4.6914200e+005
  8.6913000e+004  4.6892100e+005
  8.6814000e+004  4.6868900e+005
  8.6663000e+004  4.6848800e+005
  8.6551000e+004  4.6826300e+005
  8.6397000e+004  4.6806600e+005
  8.6286000e+004  4.6784000e+005
  8.6141000e+004  4.6763600e+005
  8.5988000e+004  4.6743700e+005
  8.5867000e+004  4.6721600e+005
  8.5730000e+004  4.6700700e+005
  8.5544000e+004  4.6683000e+005
  8.5441000e+004  4.6659900e+005
  8.5305000e+004  4.6638900e+005
  8.5169000e+004  4.6617900e+005
  8.5025000e+004  4.6597500e+005
  8.4872000e+004  4.6577700e+005
  8.4738000e+004  4.6558700e+005
  8.4586000e+004  4.6539000e+005
  8.4435000e+004  4.6519100e+005
  8.4283000e+004  4.6499300e+005
  8.4128000e+004  4.6477400e+005
  8.3958000e+004  4.6459300e+005
  8.3825000e+004  4.6437900e+005
  8.3684000e+004  4.6417000e+005
  8.3536000e+004  4.6396900e+005
  8.3333000e+004  4.6381200e+005
  8.3208000e+004  4.6359200e+005
  8.3043000e+004  4.6340200e+005
  8.2917000e+004  4.6318100e+005
  8.2754000e+004  4.6299200e+005
  8.2566000e+004  4.6282100e+005
  8.2449000e+004  4.6259500e+005
  8.2299000e+004  4.6239200e+005
  8.2141000e+004  4.6219900e+005
  8.1975000e+004  4.6201200e+005
  8.1809000e+004  4.6182600e+005
  8.1666000e+004  4.6162000e+005
  8.1492000e+004  4.6144000e+005
  8.1353000e+004  4.6123000e+005
  8.1175000e+004  4.6105300e+005
  8.1037000e+004  4.6083700e+005
  8.0835000e+004  4.6068700e+005
]]


-- baseline or reference coastline
-- đường cơ sở
baseline = [[
  8.9363293e+004  4.7297661e+005
  9.2945441e+004  4.8011839e+005
  9.6847115e+004  4.8895663e+005
  9.8922845e+004  4.9450222e+005
  9.9687538e+004  4.9683568e+005
  1.0003736e+005  4.9856260e+005
  1.0070112e+005  5.0097293e+005
  1.0158548e+005  5.0506168e+005
  1.0303233e+005  5.1410787e+005
]]

-- coastline after simulation 
-- tọa độ đường bờ đo đạc thời điểm kết thúc mô phỏng
xy2007 = [[
  1.1013800e+005  5.5181800e+005
  1.1010500e+005  5.5172300e+005
  1.1004000e+005  5.5153300e+005
  1.0997100e+005  5.5134600e+005
  1.0992600e+005  5.5115300e+005
  1.0984900e+005  5.5092000e+005
  1.0981300e+005  5.5072800e+005
  1.0978900e+005  5.5056100e+005
  1.0975700e+005  5.5036800e+005
  1.0971600e+005  5.5017100e+005
  1.0970300e+005  5.4997600e+005
  1.0968100e+005  5.4977700e+005
  1.0966900e+005  5.4958200e+005
  1.0963200e+005  5.4938800e+005
  1.0963000e+005  5.4918900e+005
  1.0962200e+005  5.4898800e+005
  1.0966600e+005  5.4878600e+005
  1.0964400e+005  5.4858700e+005
  1.0963600e+005  5.4838500e+005
  1.0963900e+005  5.4818700e+005
  1.0963700e+005  5.4798400e+005
  1.0963500e+005  5.4778000e+005
  1.0962200e+005  5.4758100e+005
  1.0961500e+005  5.4738100e+005
  1.0961300e+005  5.4718100e+005
  1.0959500e+005  5.4698400e+005
  1.0957800e+005  5.4678300e+005
  1.0956700e+005  5.4658200e+005
  1.0958000e+005  5.4637900e+005
  1.0956400e+005  5.4618000e+005
  1.0956800e+005  5.4597900e+005
  1.0953700e+005  5.4578100e+005
  1.0953600e+005  5.4558200e+005
  1.0951900e+005  5.4538100e+005
  1.0949300e+005  5.4518000e+005
  1.0946200e+005  5.4498300e+005
  1.0940000e+005  5.4478900e+005
  1.0940400e+005  5.4458400e+005
  1.0938900e+005  5.4438400e+005
  1.0934800e+005  5.4418500e+005
  1.0929400e+005  5.4399900e+005
  1.0927300e+005  5.4380300e+005
  1.0922700e+005  5.4360400e+005
  1.0918500e+005  5.4340000e+005
  1.0913400e+005  5.4320200e+005
  1.0908400e+005  5.4301000e+005
  1.0901800e+005  5.4282200e+005
  1.0897600e+005  5.4262400e+005
  1.0894300e+005  5.4242400e+005
  1.0886600e+005  5.4228000e+005
  1.0882400e+005  5.4212600e+005
  1.0879000e+005  5.4196500e+005
  1.0875000e+005  5.4182100e+005
  1.0870200e+005  5.4166700e+005
  1.0864800e+005  5.4152700e+005
  1.0860000e+005  5.4137300e+005
  1.0858000e+005  5.4122300e+005
  1.0854000e+005  5.4107900e+005
  1.0849000e+005  5.4093700e+005
  1.0845200e+005  5.4080200e+005
  1.0841700e+005  5.4065600e+005
  1.0837700e+005  5.4051100e+005
  1.0833200e+005  5.4036800e+005
  1.0830200e+005  5.4022100e+005
  1.0826400e+005  5.4006600e+005
  1.0822400e+005  5.3992100e+005
  1.0818900e+005  5.3977500e+005
  1.0815800e+005  5.3962800e+005
  1.0810800e+005  5.3948600e+005
  1.0807300e+005  5.3934000e+005
  1.0805200e+005  5.3919000e+005
  1.0798800e+005  5.3903200e+005
  1.0792700e+005  5.3884000e+005
  1.0787300e+005  5.3864000e+005
  1.0782900e+005  5.3843600e+005
  1.0777700e+005  5.3824200e+005
  1.0772200e+005  5.3804400e+005
  1.0767300e+005  5.3784600e+005
  1.0762700e+005  5.3764500e+005
  1.0756800e+005  5.3745000e+005
  1.0752000e+005  5.3725300e+005
  1.0747500e+005  5.3705200e+005
  1.0744900e+005  5.3684200e+005
  1.0741300e+005  5.3663800e+005
  1.0738400e+005  5.3643800e+005
  1.0734400e+005  5.3623300e+005
  1.0728400e+005  5.3603500e+005
  1.0721900e+005  5.3583700e+005
  1.0717900e+005  5.3563600e+005
  1.0712000e+005  5.3544000e+005
  1.0703100e+005  5.3524800e+005
  1.0699400e+005  5.3504100e+005
  1.0692700e+005  5.3487100e+005
  1.0689900e+005  5.3472400e+005
  1.0682900e+005  5.3459900e+005
  1.0679400e+005  5.3446300e+005
  1.0670900e+005  5.3429900e+005
  1.0665200e+005  5.3412200e+005
  1.0659900e+005  5.3395500e+005
  1.0654200e+005  5.3379300e+005
  1.0646500e+005  5.3362000e+005
  1.0640900e+005  5.3347900e+005
  1.0637600e+005  5.3334200e+005
  1.0634900e+005  5.3319200e+005
  1.0629400e+005  5.3305200e+005
  1.0623500e+005  5.3291400e+005
  1.0620200e+005  5.3277700e+005
  1.0614700e+005  5.3264800e+005
  1.0609800e+005  5.3252700e+005
  1.0605500e+005  5.3240500e+005
  1.0599900e+005  5.3227700e+005
  1.0594200e+005  5.3208500e+005
  1.0583700e+005  5.3193700e+005
  1.0578100e+005  5.3182600e+005
  1.0572100e+005  5.3171500e+005
  1.0565800e+005  5.3161200e+005
  1.0556000e+005  5.3140300e+005
  1.0546600e+005  5.3119300e+005
  1.0538500e+005  5.3093300e+005
  1.0530900e+005  5.3068300e+005
  1.0524400e+005  5.3043600e+005
  1.0518200e+005  5.3018500e+005
  1.0514600e+005  5.3004000e+005
  1.0510500e+005  5.2987200e+005
  1.0506300e+005  5.2970400e+005
  1.0502500e+005  5.2953500e+005
  1.0499500e+005  5.2938800e+005
  1.0496900e+005  5.2926000e+005
  1.0494200e+005  5.2913100e+005
  1.0491700e+005  5.2900600e+005
  1.0488600e+005  5.2885600e+005
  1.0485100e+005  5.2868500e+005
  1.0482100e+005  5.2853900e+005
  1.0479500e+005  5.2841300e+005
  1.0476900e+005  5.2828700e+005
  1.0474200e+005  5.2815300e+005
  1.0471100e+005  5.2800200e+005
  1.0467600e+005  5.2783000e+005
  1.0464500e+005  5.2768400e+005
  1.0462100e+005  5.2755900e+005
  1.0458300e+005  5.2737500e+005
  1.0453100e+005  5.2712300e+005
  1.0447900e+005  5.2687500e+005
  1.0449400e+005  5.2659600e+005
  1.0445100e+005  5.2636400e+005
  1.0442600e+005  5.2611600e+005
  1.0442700e+005  5.2591500e+005
  1.0441600e+005  5.2571000e+005
  1.0435600e+005  5.2555300e+005
  1.0436200e+005  5.2538900e+005
  1.0435800e+005  5.2524100e+005
  1.0432700e+005  5.2506900e+005
  1.0429500e+005  5.2488800e+005
  1.0427700e+005  5.2471200e+005
  1.0421900e+005  5.2455700e+005
  1.0422000e+005  5.2439500e+005
  1.0420800e+005  5.2424700e+005
  1.0414400e+005  5.2408200e+005
  1.0412700e+005  5.2389900e+005
  1.0411300e+005  5.2373000e+005
  1.0408500e+005  5.2349900e+005
  1.0404100e+005  5.2328200e+005
  1.0402300e+005  5.2308600e+005
  1.0400200e+005  5.2286100e+005
  1.0400000e+005  5.2272800e+005
  1.0399600e+005  5.2247900e+005
  1.0396800e+005  5.2222900e+005
  1.0394900e+005  5.2198000e+005
  1.0391000e+005  5.2173300e+005
  1.0385600e+005  5.2148900e+005
  1.0377800e+005  5.2124600e+005
  1.0376000e+005  5.2099700e+005
  1.0369500e+005  5.2074900e+005
  1.0366100e+005  5.2050100e+005
  1.0360700e+005  5.2025600e+005
  1.0358800e+005  5.2000700e+005
  1.0353900e+005  5.1975600e+005
  1.0351000e+005  5.1950900e+005
  1.0350600e+005  5.1925700e+005
  1.0343700e+005  5.1901400e+005
  1.0342200e+005  5.1876200e+005
  1.0339300e+005  5.1851200e+005
  1.0333900e+005  5.1826600e+005
  1.0334000e+005  5.1801400e+005
  1.0335500e+005  5.1776000e+005
  1.0332800e+005  5.1751100e+005
  1.0329000e+005  5.1726300e+005
  1.0323300e+005  5.1701700e+005
  1.0321000e+005  5.1676800e+005
  1.0317300e+005  5.1652100e+005
  1.0313500e+005  5.1627200e+005
  1.0309300e+005  5.1602600e+005
  1.0305600e+005  5.1578000e+005
  1.0302800e+005  5.1553300e+005
  1.0299900e+005  5.1528500e+005
  1.0295000e+005  5.1504000e+005
  1.0291700e+005  5.1479500e+005
  1.0288900e+005  5.1454800e+005
  1.0286500e+005  5.1429800e+005
  1.0284600e+005  5.1404800e+005
  1.0281300e+005  5.1379900e+005
  1.0277900e+005  5.1355000e+005
  1.0275500e+005  5.1330200e+005
  1.0271600e+005  5.1305500e+005
  1.0266200e+005  5.1280400e+005
  1.0262800e+005  5.1255600e+005
  1.0262400e+005  5.1230500e+005
  1.0259000e+005  5.1205700e+005
  1.0256600e+005  5.1180600e+005
  1.0251700e+005  5.1156000e+005
  1.0250900e+005  5.1130900e+005
  1.0242600e+005  5.1106900e+005
  1.0241700e+005  5.1081700e+005
  1.0236400e+005  5.1057200e+005
  1.0235400e+005  5.1032000e+005
  1.0229100e+005  5.1007600e+005
  1.0228600e+005  5.0982300e+005
  1.0223400e+005  5.0957800e+005
  1.0218500e+005  5.0933300e+005
  1.0211100e+005  5.0909200e+005
  1.0207800e+005  5.0884500e+005
  1.0205300e+005  5.0859400e+005
  1.0201800e+005  5.0834800e+005
  1.0197400e+005  5.0810200e+005
  1.0192000e+005  5.0785900e+005
  1.0186500e+005  5.0761800e+005
  1.0188200e+005  5.0735800e+005
  1.0177200e+005  5.0712600e+005
  1.0174100e+005  5.0687700e+005
  1.0169500e+005  5.0663100e+005
  1.0165900e+005  5.0638300e+005
  1.0163300e+005  5.0613500e+005
  1.0155300e+005  5.0589400e+005
  1.0151600e+005  5.0564600e+005
  1.0150000e+005  5.0539500e+005
  1.0144400e+005  5.0515100e+005
  1.0140800e+005  5.0490200e+005
  1.0138100e+005  5.0465300e+005
  1.0133000e+005  5.0440800e+005
  1.0128900e+005  5.0416100e+005
  1.0120400e+005  5.0392300e+005
  1.0116700e+005  5.0367500e+005
  1.0110500e+005  5.0343300e+005
  1.0104400e+005  5.0319200e+005
  1.0097300e+005  5.0295000e+005
  1.0090600e+005  5.0270800e+005
  1.0083500e+005  5.0246800e+005
  1.0080900e+005  5.0221800e+005
  1.0073700e+005  5.0197700e+005
  1.0066100e+005  5.0173900e+005
  1.0056100e+005  5.0150600e+005
  1.0046500e+005  5.0127200e+005
  1.0039300e+005  5.0102900e+005
  1.0029800e+005  5.0079300e+005
  1.0021200e+005  5.0058800e+005
  1.0011900e+005  5.0035500e+005
  1.0002200e+005  5.0012500e+005
  9.9925000e+004  4.9989500e+005
  9.9828000e+004  4.9966800e+005
  9.9722000e+004  4.9944200e+005
  9.9607000e+004  4.9919700e+005
  9.9472000e+004  4.9898100e+005
  9.9349000e+004  4.9876700e+005
  9.9203000e+004  4.9855200e+005
  9.9058000e+004  4.9833500e+005
  9.8241000e+004  4.9700300e+005
  9.8357000e+004  4.9670500e+005
  9.8436000e+004  4.9642000e+005
  9.8505000e+004  4.9613700e+005
  9.8614000e+004  4.9584200e+005
  9.8655000e+004  4.9556900e+005
  9.8613000e+004  4.9529900e+005
  9.8606000e+004  4.9504000e+005
  9.8618000e+004  4.9477400e+005
  9.8592000e+004  4.9452400e+005
  9.8575000e+004  4.9426700e+005
  9.8557000e+004  4.9400700e+005
  9.8493000e+004  4.9376500e+005
  9.8448000e+004  4.9351800e+005
  9.8364000e+004  4.9328100e+005
  9.8308000e+004  4.9303800e+005
  9.8234000e+004  4.9279900e+005
  9.8170000e+004  4.9255700e+005
  9.8106000e+004  4.9231500e+005
  9.8006000e+004  4.9208600e+005
  9.7917000e+004  4.9185300e+005
  9.7808000e+004  4.9162700e+005
  9.7710000e+004  4.9139900e+005
  9.7629000e+004  4.9116200e+005
  9.7530000e+004  4.9093300e+005
  9.7421000e+004  4.9070700e+005
  9.7313000e+004  4.9048100e+005
  9.7222000e+004  4.9024600e+005
  9.7114000e+004  4.9002000e+005
  9.7014000e+004  4.8979000e+005
  9.6935000e+004  4.8955400e+005
  9.6829000e+004  4.8932900e+005
  9.6742000e+004  4.8909400e+005
  9.6674000e+004  4.8885400e+005
  9.6549000e+004  4.8863600e+005
  9.6444000e+004  4.8841000e+005
  9.6347000e+004  4.8817900e+005
  9.6240000e+004  4.8795000e+005
  9.6124000e+004  4.8772600e+005
  9.6047000e+004  4.8748800e+005
  9.5951000e+004  4.8726000e+005
  9.5863000e+004  4.8702200e+005
  9.5757000e+004  4.8679600e+005
  9.5697000e+004  4.8655000e+005
  9.5592000e+004  4.8632400e+005
  9.5522000e+004  4.8608100e+005
  9.5453000e+004  4.8583900e+005
  9.5365000e+004  4.8560500e+005
  9.5268000e+004  4.8537400e+005
  9.5154000e+004  4.8515100e+005
  9.5038000e+004  4.8492700e+005
  9.4969000e+004  4.8468600e+005
  9.4872000e+004  4.8445500e+005
  9.4767000e+004  4.8422700e+005
  9.4670000e+004  4.8399600e+005
  9.4554000e+004  4.8377300e+005
  9.4467000e+004  4.8354000e+005
  9.4379000e+004  4.8330400e+005
  9.4264000e+004  4.8308200e+005
  9.4164000e+004  4.8285400e+005
  9.4072000e+004  4.8262200e+005
  9.3962000e+004  4.8239800e+005
  9.3846000e+004  4.8217300e+005
  9.3758000e+004  4.8193800e+005
  9.3640000e+004  4.8171800e+005
  9.3524000e+004  4.8149400e+005
  9.3438000e+004  4.8131200e+005
  9.3335000e+004  4.8109000e+005
  9.3207000e+004  4.8087400e+005
  9.3117000e+004  4.8065600e+005
  9.3009000e+004  4.8041400e+005
  9.2903000e+004  4.8018600e+005
  9.2806000e+004  4.7995500e+005
  9.2687000e+004  4.7973500e+005
  9.2600000e+004  4.7949800e+005
  9.2476000e+004  4.7928000e+005
  9.2389000e+004  4.7904600e+005
  9.2270000e+004  4.7882500e+005
  9.2168000e+004  4.7859400e+005
  9.2049000e+004  4.7837300e+005
  9.1939000e+004  4.7814900e+005
  9.1820000e+004  4.7792900e+005
  9.1668000e+004  4.7772300e+005
  9.1599000e+004  4.7747900e+005
  9.1441000e+004  4.7728000e+005
  9.1388000e+004  4.7702500e+005
  9.1233000e+004  4.7682200e+005
  9.1126000e+004  4.7660100e+005
  9.1004000e+004  4.7638000e+005
  9.0940000e+004  4.7613200e+005
  9.0778000e+004  4.7593300e+005
  9.0666000e+004  4.7570900e+005
  9.0544000e+004  4.7549200e+005
  9.0449000e+004  4.7525800e+005
  9.0309000e+004  4.7504800e+005
  9.0192000e+004  4.7482700e+005
  9.0031000e+004  4.7462900e+005
  8.9901000e+004  4.7441600e+005
  8.9774000e+004  4.7419700e+005
  8.9653000e+004  4.7397900e+005
  8.9536000e+004  4.7375800e+005
  8.9450000e+004  4.7352100e+005
  8.9317000e+004  4.7330400e+005
  8.9206000e+004  4.7308200e+005
  8.9085000e+004  4.7286400e+005
  8.8984000e+004  4.7263200e+005
  8.8868000e+004  4.7241300e+005
  8.8759000e+004  4.7218900e+005
  8.8652000e+004  4.7196200e+005
  8.8529000e+004  4.7174500e+005
  8.8414000e+004  4.7152200e+005
  8.8278000e+004  4.7131100e+005
  8.8162000e+004  4.7108800e+005
  8.8018000e+004  4.7088600e+005
  8.7894000e+004  4.7066600e+005
  8.7762000e+004  4.7045400e+005
  8.7634000e+004  4.7024000e+005
  8.7501000e+004  4.7002600e+005
  8.7490000e+004  4.6974300e+005
  8.7271000e+004  4.6958300e+005
  8.7147000e+004  4.6936800e+005
  8.7004000e+004  4.6915900e+005
  8.6887000e+004  4.6893600e+005
  8.6749000e+004  4.6872700e+005
  8.6620000e+004  4.6851400e+005
  8.6504000e+004  4.6829100e+005
  8.6363000e+004  4.6808800e+005
  8.6232000e+004  4.6787600e+005
  8.6116000e+004  4.6765300e+005
  8.5963000e+004  4.6745400e+005
  8.5834000e+004  4.6723800e+005
  8.5701000e+004  4.6702700e+005
  8.5549000e+004  4.6682800e+005
  8.5412000e+004  4.6661900e+005
  8.5259000e+004  4.6642000e+005
  8.5111000e+004  4.6621900e+005
  8.4963000e+004  4.6601800e+005
  8.4819000e+004  4.6581400e+005
  8.4689000e+004  4.6562100e+005
  8.4529000e+004  4.6543000e+005
  8.4386000e+004  4.6522600e+005
  8.4242000e+004  4.6502200e+005
  8.4084000e+004  4.6480700e+005
  8.3930000e+004  4.6461400e+005
  8.3771000e+004  4.6442400e+005
  8.3629000e+004  4.6421400e+005
  8.3458000e+004  4.6403200e+005
  8.3333000e+004  4.6381200e+005
  8.3177000e+004  4.6361700e+005
  8.3039000e+004  4.6340500e+005
  8.2882000e+004  4.6320900e+005
  8.2722000e+004  4.6301700e+005
  8.2586000e+004  4.6280500e+005
  8.2434000e+004  4.6260700e+005
  8.2277000e+004  4.6241100e+005
  8.2115000e+004  4.6222200e+005
  8.1964000e+004  4.6202200e+005
  8.1817000e+004  4.6181900e+005
  8.1636000e+004  4.6164700e+005
  8.1474000e+004  4.6145600e+005
  8.1308000e+004  4.6126900e+005
  8.1168000e+004  4.6105900e+005
  8.1000000e+004  4.6087200e+005
  8.0817000e+004  4.6070400e+005
]]


-- Load variables
-- Tải giá trị vào các biến số
-- string.gmatch có tác dụng lọc lấy hai số liệu với pattern là (%S+) một dòng 
-- (%S+) có nghĩa là những kí tự liên tiếp không phải là dấu cách 
xg = {}; yg = {}; i = 0
for x, y in string.gmatch(ijmuiden, "(%S+)%s+(%S+)%s+") do 
	if tonumber(x) ~= -999 and tonumber(y) ~= -999 then
		i = i + 1
		xg[i] = tonumber(x)
		yg[i] = tonumber(y)
	end
end

xi = {}; yi = {}; i = 0
for x, y in string.gmatch(xy1967, "(%S+)%s+(%S+)%s+") do 
	i = i + 1
	xi[i], yi[i] = tonumber(x), tonumber(y)
end

xf = {}; yf = {}; i = 0
for x, y in string.gmatch(xy2007, "(%S+)%s+(%S+)%s+") do 
	i = i + 1
	xf[i], yf[i] = tonumber(x), tonumber(y)
end

xref = {}; yref = {}; i = 0
for x, y in string.gmatch(baseline, "(%S+)%s+(%S+)%s+") do 
	i = i + 1
	xref[i], yref[i] = tonumber(x), tonumber(y)
end


-- Compute distance along reference coastline
-- Tính khoảng cách dọc theo đường cơ sở 
dist = {0}
for i = 2, #xref do
	dist[i] = dist[i-1] + math.sqrt((xref[i] - xref[i-1])^2 + (yref[i] - yref[i-1])^2)
end

-- Create computational grid
-- Lập lưới tính toán
ds = (dist[#xref] - dist[1]) / (ns - 1)
s = {}
for i = 1, ns do
	s[i] = (i-1)*ds 
end

spl = num.bspline(0, floor(s[#s]), 20)
xsamp = matrix.new(#xref, 1, |i| xref[i])
xr = spl:model(xsamp)


-- wave climate including probability, Tp, Hm0, direction
-- chế độ sóng bao gồm xác suất xuất hiện của sóng, chu kì đỉnh, chiều cao sóng ý nghĩa (hay mô-men bậc 0) và hướng sóng
climate = [[
    1.9120     0.35     4.64       10
    2.4470     0.72     5.07       10
    0.8660     1.19     5.49       10
    0.1640     1.70     6.01       10
    0.0210     2.10     6.52       10
    0.0110     2.67     7.43       10
    0.0000     0.00     0.00       10
    0.0000     0.00     0.00       10
    0.0000     0.00     0.00       10
    0.0000     0.00     0.00       10
    0.0000     0.00     0.00       10
    0.0000     0.00     0.00       10
    0.0000     0.00     0.00       10
    0.0000     0.00     0.00       10
    0.0000     0.00     0.00       10
    0.0000     0.00     0.00       10
    0.0000     0.00     0.00       10
    0.0000     0.00     0.00       10
    0.0000     0.00     0.00       10
    0.0000     0.00     0.00       10
    1.0640     0.36     4.40       30
    1.1880     0.70     4.73       30
    0.2380     1.20     5.24       30
    0.0460     1.66     5.87       30
    0.0060     2.22     6.86       30
    0.0010     2.86     7.02       30
    0.0000     0.00     0.00       30
    0.0000     0.00     0.00       30
    0.0000     0.00     0.00       30
    0.0000     0.00     0.00       30
    0.0000     0.00     0.00       30
    0.0000     0.00     0.00       30
    0.0000     0.00     0.00       30
    0.0000     0.00     0.00       30
    0.0000     0.00     0.00       30
    0.0000     0.00     0.00       30
    0.0000     0.00     0.00       30
    0.0000     0.00     0.00       30
    0.0000     0.00     0.00       30
    0.0000     0.00     0.00       30
    0.5260     0.38     4.27       50
    0.5780     0.67     4.43       50
    0.0630     1.20     5.14       50
    0.0070     1.58     5.77       50
    0.0000     0.00     0.00       50
    0.0010     2.55     6.37       50
    0.0000     0.00     0.00       50
    0.0000     0.00     0.00       50
    0.0000     0.00     0.00       50
    0.0000     0.00     0.00       50
    0.0000     0.00     0.00       50
    0.0000     0.00     0.00       50
    0.0000     0.00     0.00       50
    0.0000     0.00     0.00       50
    0.0000     0.00     0.00       50
    0.0000     0.00     0.00       50
    0.0000     0.00     0.00       50
    0.0000     0.00     0.00       50
    0.0000     0.00     0.00       50
    0.0000     0.00     0.00       50
    0.3350     0.38     4.02       70
    0.3440     0.67     4.25       70
    0.0390     1.17     5.08       70
    0.0010     1.65     6.24       70
    0.0000     0.00     0.00       70
    0.0000     0.00     0.00       70
    0.0000     0.00     0.00       70
    0.0000     0.00     0.00       70
    0.0000     0.00     0.00       70
    0.0000     0.00     0.00       70
    0.0000     0.00     0.00       70
    0.0000     0.00     0.00       70
    0.0000     0.00     0.00       70
    0.0000     0.00     0.00       70
    0.0000     0.00     0.00       70
    0.0000     0.00     0.00       70
    0.0000     0.00     0.00       70
    0.0000     0.00     0.00       70
    0.0000     0.00     0.00       70
    0.0000     0.00     0.00       70
    0.3010     0.39     3.87       90
    0.2200     0.65     4.12       90
    0.0200     1.13     4.75       90
    0.0010     1.65     6.76       90
    0.0010     2.21     6.50       90
    0.0000     0.00     0.00       90
    0.0000     0.00     0.00       90
    0.0010     3.74     8.19       90
    0.0000     0.00     0.00       90
    0.0000     0.00     0.00       90
    0.0000     0.00     0.00       90
    0.0000     0.00     0.00       90
    0.0000     0.00     0.00       90
    0.0000     0.00     0.00       90
    0.0000     0.00     0.00       90
    0.0000     0.00     0.00       90
    0.0000     0.00     0.00       90
    0.0000     0.00     0.00       90
    0.0000     0.00     0.00       90
    0.0000     0.00     0.00       90
    0.2810     0.38     3.93      110
    0.2170     0.64     4.04      110
    0.0040     1.25     5.85      110
    0.0030     1.69     5.98      110
    0.0010     2.21     5.46      110
    0.0000     0.00     0.00      110
    0.0000     0.00     0.00      110
    0.0000     0.00     0.00      110
    0.0000     0.00     0.00      110
    0.0000     0.00     0.00      110
    0.0000     0.00     0.00      110
    0.0000     0.00     0.00      110
    0.0000     0.00     0.00      110
    0.0000     0.00     0.00      110
    0.0000     0.00     0.00      110
    0.0000     0.00     0.00      110
    0.0000     0.00     0.00      110
    0.0000     0.00     0.00      110
    0.0000     0.00     0.00      110
    0.0000     0.00     0.00      110
    0.3490     0.38     3.96      130
    0.2070     0.62     4.21      130
    0.0090     1.19     6.22      130
    0.0070     1.71     6.47      130
    0.0030     2.29     7.60      130
    0.0000     0.00     0.00      130
    0.0000     0.00     0.00      130
    0.0000     0.00     0.00      130
    0.0000     0.00     0.00      130
    0.0000     0.00     0.00      130
    0.0000     0.00     0.00      130
    0.0000     0.00     0.00      130
    0.0000     0.00     0.00      130
    0.0000     0.00     0.00      130
    0.0000     0.00     0.00      130
    0.0000     0.00     0.00      130
    0.0000     0.00     0.00      130
    0.0000     0.00     0.00      130
    0.0000     0.00     0.00      130
    0.0000     0.00     0.00      130
    0.4260     0.37     4.21      150
    0.2740     0.66     4.37      150
    0.0310     1.18     5.69      150
    0.0010     1.70     6.37      150
    0.0090     2.21     6.70      150
    0.0000     0.00     0.00      150
    0.0030     3.15     8.38      150
    0.0030     3.90     8.13      150
    0.0000     0.00     0.00      150
    0.0000     0.00     0.00      150
    0.0000     0.00     0.00      150
    0.0000     0.00     0.00      150
    0.0000     0.00     0.00      150
    0.0000     0.00     0.00      150
    0.0000     0.00     0.00      150
    0.0000     0.00     0.00      150
    0.0000     0.00     0.00      150
    0.0000     0.00     0.00      150
    0.0000     0.00     0.00      150
    0.0000     0.00     0.00      150
    0.3950     0.36     4.37      170
    0.4490     0.70     4.73      170
    0.1070     1.18     5.66      170
    0.0230     1.78     6.06      170
    0.0160     2.24     6.61      170
    0.0040     2.59     7.41      170
    0.0000     0.00     0.00      170
    0.0000     0.00     0.00      170
    0.0000     0.00     0.00      170
    0.0000     0.00     0.00      170
    0.0000     0.00     0.00      170
    0.0000     0.00     0.00      170
    0.0000     0.00     0.00      170
    0.0000     0.00     0.00      170
    0.0000     0.00     0.00      170
    0.0000     0.00     0.00      170
    0.0000     0.00     0.00      170
    0.0000     0.00     0.00      170
    0.0000     0.00     0.00      170
    0.0000     0.00     0.00      170
    0.5100     0.37     4.39      190
    0.7240     0.73     4.81      190
    0.3020     1.19     5.55      190
    0.0800     1.73     6.16      190
    0.0170     2.21     6.55      190
    0.0030     2.94     6.83      190
    0.0000     0.00     0.00      190
    0.0000     0.00     0.00      190
    0.0000     0.00     0.00      190
    0.0000     0.00     0.00      190
    0.0000     0.00     0.00      190
    0.0000     0.00     0.00      190
    0.0000     0.00     0.00      190
    0.0000     0.00     0.00      190
    0.0000     0.00     0.00      190
    0.0000     0.00     0.00      190
    0.0000     0.00     0.00      190
    0.0000     0.00     0.00      190
    0.0000     0.00     0.00      190
    0.0000     0.00     0.00      190
    0.5930     0.37     4.45      210
    1.2020     0.74     4.87      210
    0.6520     1.21     5.56      210
    0.2240     1.71     6.17      210
    0.0510     2.20     6.83      210
    0.0140     2.71     7.25      210
    0.0030     3.31     7.93      210
    0.0000     0.00     0.00      210
    0.0000     0.00     0.00      210
    0.0000     0.00     0.00      210
    0.0000     0.00     0.00      210
    0.0000     0.00     0.00      210
    0.0000     0.00     0.00      210
    0.0000     0.00     0.00      210
    0.0000     0.00     0.00      210
    0.0000     0.00     0.00      210
    0.0000     0.00     0.00      210
    0.0000     0.00     0.00      210
    0.0000     0.00     0.00      210
    0.0000     0.00     0.00      210
    0.8960     0.38     4.52      230
    3.0620     0.77     4.98      230
    3.0290     1.24     5.64      230
    2.1890     1.73     6.24      230
    1.0420     2.22     6.77      230
    0.3320     2.71     7.24      230
    0.0860     3.19     7.65      230
    0.0130     3.69     8.31      230
    0.0040     4.07     8.45      230
    0.0010     4.67     9.36      230
    0.0000     0.00     0.00      230
    0.0000     0.00     0.00      230
    0.0000     0.00     0.00      230
    0.0000     0.00     0.00      230
    0.0000     0.00     0.00      230
    0.0000     0.00     0.00      230
    0.0000     0.00     0.00      230
    0.0000     0.00     0.00      230
    0.0000     0.00     0.00      230
    0.0000     0.00     0.00      230
    1.8350     0.37     4.61      250
    4.1650     0.75     5.11      250
    3.3710     1.25     5.77      250
    2.2890     1.74     6.37      250
    1.2560     2.23     6.93      250
    0.6550     2.72     7.44      250
    0.2700     3.21     7.88      250
    0.0980     3.70     8.44      250
    0.0500     4.21     8.83      250
    0.0070     4.67     9.10      250
    0.0070     5.18     9.44      250
    0.0030     5.76     9.88      250
    0.0030     6.14    10.01      250
    0.0000     0.00     0.00      250
    0.0000     0.00     0.00      250
    0.0000     0.00     0.00      250
    0.0000     0.00     0.00      250
    0.0000     0.00     0.00      250
    0.0000     0.00     0.00      250
    0.0000     0.00     0.00      250
    2.4100     0.35     4.79      270
    2.9280     0.74     5.32      270
    1.9880     1.24     5.88      270
    1.1920     1.73     6.46      270
    0.6370     2.23     7.02      270
    0.3170     2.75     7.56      270
    0.1770     3.25     8.11      270
    0.0860     3.72     8.49      270
    0.0300     4.22     8.98      270
    0.0200     4.74     9.21      270
    0.0110     5.21     9.77      270
    0.0000     0.00     0.00      270
    0.0000     0.00     0.00      270
    0.0000     0.00     0.00      270
    0.0000     0.00     0.00      270
    0.0000     0.00     0.00      270
    0.0000     0.00     0.00      270
    0.0000     0.00     0.00      270
    0.0000     0.00     0.00      270
    0.0000     0.00     0.00      270
    2.8030     0.32     5.03      290
    2.8750     0.75     5.56      290
    1.8210     1.24     6.06      290
    1.0810     1.72     6.56      290
    0.5820     2.21     7.05      290
    0.2950     2.72     7.58      290
    0.1780     3.27     8.13      290
    0.0910     3.73     8.54      290
    0.0410     4.24     8.98      290
    0.0240     4.68     9.41      290
    0.0140     5.14     9.78      290
    0.0000     0.00     0.00      290
    0.0000     0.00     0.00      290
    0.0000     0.00     0.00      290
    0.0000     0.00     0.00      290
    0.0000     0.00     0.00      290
    0.0000     0.00     0.00      290
    0.0000     0.00     0.00      290
    0.0000     0.00     0.00      290
    0.0000     0.00     0.00      290
    3.5010     0.32     5.30      310
    3.7850     0.75     5.93      310
    2.6280     1.24     6.30      310
    1.6260     1.72     6.69      310
    0.9110     2.23     7.21      310
    0.4450     2.73     7.77      310
    0.2440     3.23     8.25      310
    0.1200     3.72     8.76      310
    0.0610     4.22     9.14      310
    0.0270     4.66     9.55      310
    0.0140     5.18    10.15      310
    0.0030     5.76    10.98      310
    0.0000     0.00     0.00      310
    0.0000     0.00     0.00      310
    0.0000     0.00     0.00      310
    0.0000     0.00     0.00      310
    0.0000     0.00     0.00      310
    0.0000     0.00     0.00      310
    0.0000     0.00     0.00      310
    0.0000     0.00     0.00      310
    4.0510     0.34     5.34      330
    5.8680     0.75     6.07      330
    2.9830     1.22     6.33      330
    1.3060     1.72     6.71      330
    0.5660     2.23     7.32      330
    0.3690     2.73     7.88      330
    0.1750     3.22     8.39      330
    0.0780     3.73     8.86      330
    0.0390     4.23     9.40      330
    0.0200     4.69     9.71      330
    0.0100     5.24    10.42      330
    0.0030     5.71    10.98      330
    0.0000     0.00     0.00      330
    0.0000     0.00     0.00      330
    0.0000     0.00     0.00      330
    0.0000     0.00     0.00      330
    0.0000     0.00     0.00      330
    0.0000     0.00     0.00      330
    0.0000     0.00     0.00      330
    0.0000     0.00     0.00      330
    2.9160     0.35     4.94      350
    4.2040     0.73     5.50      350
    1.6330     1.21     5.89      350
    0.4080     1.69     6.36      350
    0.1060     2.20     6.96      350
    0.0270     2.71     7.56      350
    0.0100     3.20     8.02      350
    0.0000     0.00     0.00      350
    0.0000     0.00     0.00      350
    0.0000     0.00     0.00      350
    0.0000     0.00     0.00      350
    0.0000     0.00     0.00      350
    0.0000     0.00     0.00      350
    0.0000     0.00     0.00      350
    0.0000     0.00     0.00      350
    0.0000     0.00     0.00      350
    0.0000     0.00     0.00      350
    0.0000     0.00     0.00      350
    0.0000     0.00     0.00      350
    0.0000     0.00     0.00      350
]]



profile = [[
-2500  -20 
-1500  -10
 -500   -5
 -300   -3
    0    0
  100    2
  ]]
